from util import file_helper_V_file


class File:
    def __init__(self, folder_path, file_name=None, file_qz=None) -> None:
        self.folder_path = folder_path
        self.file_name = file_name
        self.file_qz = file_qz

    def get_qz_获取文件名前缀(self):
        if self.file_qz == None:
            return file_helper_V_file.tqwjmqz_提取文件前缀(self.file_name)
        return self.file_qz

    def get_file_path(self):
        if self.get_file_name() is None:
            return None
        else:
            return f"{self.folder_path}/{self.get_file_name()}"

    def get_file_name(self):
        if self.file_name == None:
            if self.get_qz_获取文件名前缀() != None:
                file1 = file_helper_V_file.gjwjmqzscwj_根据文件名前缀获取文件(self)
                if file1 is None:
                    return None
                self.file_name = file1.get_file_name()
        return self.file_name
